<!--{include(pe_tpl('header_dialog.html'));}-->
<div class="search">
	<form method="get">
	<input type="hidden" name="mod" value="{$_g_mod}" />
	<input type="hidden" name="act" value="{$_g_act}" />
	<input type="hidden" name="userlevel_id" value="{$_g_userlevel_id}" />
	用户名：<input type="text" name="name" value="{$_g_name}" class="inputtext input150 mar5"/>
	手机号码：<input type="text" name="phone" value="{$_g_phone}" class="inputtext input150 mar5" />
	<input type="submit" value="搜索" class="input_btn" />
	</form>
</div>
<form method="post" id="form">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
<tr>
	<th class="bgtt" width="20"><input type="checkbox" name="checkall" onclick="pe_checkall(this, 'user_name')" /></th>
	<th class="bgtt" width="50">ID号</th>
	<th class="bgtt">用户名</th>
	<th class="bgtt" width="120">等级</td>
	<th class="bgtt" width="120">手机号码</th>
	<th class="bgtt" width="120">注册日期</th>
</tr>
<!--{foreach($info_list as $v):}-->
<tr>
	<td><input type="checkbox" name="user_name[]" value="{$v['user_name']}" /></td>
	<td>{$v['user_id']}</td>
	<td>{$v['user_name']}</td>
	<td>{$cache_userlevel[$v['userlevel_id']]['userlevel_name']}</td>
	<td>{$v['user_phone']}</td>
	<td>{pe_date_color(pe_date($v['user_atime'], 'Y-m-d'))}</span></td>
</tr>
<!--{endforeach;}-->
</table>
</form>
<div class="right_bottom">
	<span class="fr fenye">{$db->page->html}</span>
	<div class="clear"></div>
</div>
<script type="text/javascript">
$(function(){
	var send_sms_window = $(window.parent.document).find("#send_sms iframe")[0].contentWindow;
	var user_name = send_sms_window.get_user();
	for (k in user_name) {
		$(":input[name='user_name[]'][value='"+user_name[k]+"']").attr("checked", "checked");
	}
	$(":checkbox").click(function(){
		//var user_name = new Array();
		user_name = send_sms_window.get_user();
		$(":input[name='user_name[]']").each(function(){
			if ($(this).is(":checked")) {
				if ($.inArray($(this).val(), user_name) == -1) user_name.push($(this).val());		
			}
			else {
				var arr_index = $.inArray($(this).val(), user_name);
				if (arr_index >= 0) user_name.splice(arr_index, 1);
				console.log(user_name.length)
			}
		})
		send_sms_window.set_user(user_name.join(','));
	});		
})
</script>
<!--{include(pe_tpl('footer_dialog.html'));}-->